#!/usr/bin/env bash
# declare a name for this job to be sample_job
#PBS -N genomic_feature_3  
# request the queue (enter the possible names, if omitted, serial is the default)
#PBS -q laird     
# request 1 node
#PBS -l nodes=1 
#PBS -l walltime=168:00:00,mem=8g
# join the standard output and error files
#PBS -j oe
# mail is sent to you when the job starts and when it terminates or aborts
#PBS -M yapingli@hpc-uec.usc.edu
# By default, PBS scripts execute in your home directory, not the 
# directory from which they were submitted. The following line 
# places you in the directory from which the job was submitted.  
cd $PBS_O_WORKDIR
# run the program

#echo "select distinct(featType) from features_chr11;" | mysql cr | grep ENCODEclst | perl -ne 'print "-feature $_";'
#echo "select distinct(featType) from features_chr11;" | mysql cr | grep Broad | perl -ne 'print "-feature $_";'

#/bin/ls -1 /Users/yaping/Documents/workspace/result/ASM/methylCGsRich_ASM_*.gtf | perl -ne 'chomp; `/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/bin/java -Xmx2g -jar /Users/yaping/Documents/workspace/featureCounter.jar $_  -feature tss -feature tss_1kb_flank -feature tss_2kb_flank -feature tss_500bp_flank -feature exon -feature EXON_NON_TSS -feature HELA_ENHNC_NOTSS_NOCTCF  -feature LINE  -feature SINE -feature MICROSAT -feature CTCF_CUDKIM -feature BroadClust500-Ctcf.gtf -feature CTCF_CUDKIM_XIE_300BP -feature CGIS_IRIZARRY_2009 -feature CAGE_TSR -feature RING1B_Ku2008  -feature K27me3_Ku2008  -feature TJ  -feature GG -feature BroadClust500-H3k27ac.gtf -feature BroadClust500-H3k27me3.gtf -feature BroadClust500-H3k36me3.gtf -feature BroadClust500-H3k4me1.gtf -feature BroadClust500-H3k4me2.gtf -feature BroadClust500-H3k4me3.gtf -feature BroadClust500-H3k9ac.gtf -feature BroadClust500-H3k9me1.gtf -feature BroadClust500-H4k20me1.gtf  -feature BroadClust500-Pol2b.gtf -feature ENCODEclst_CTCF -feature PMD_NORM_20-60_w10m100 -feature PMD_TUM_20-60_w10m100 > $_.feats.csv`'

/bin/ls -1 /home/uec-00/yapingli/code/Allele_specific_methylation/methylCGsRich_ASM_*.gtf | perl -ne 'chomp; `/home/uec-00/shared/production/software/java/default/bin/java -Xmx8g -jar /home/uec-00/yapingli/code/Allele_specific_methylation/featureCounter.jar $_ -feature FANTOM4_HCP -feature FANTOM4_LCP -feature FMPS_ALL_5PERC_10CPG_CLUST500 -feature FMPS_LOSTNORMAL_5TO35PERC_10CP -feature FMPS_LOSTTUMOR_5TO35PERC_10CPG -feature FMPS_TUMORANDNORMAL_5PERC_10CP -feature FMPS_TUMORANDNORMAL_RANDOMIZED -feature GG -feature Hawkins2010-enhancers-H1.hg18. -feature Hawkins2010-enhancers-IMR90.hg -feature Hawkins2010-K27me3-H1.hg18.gtf -feature Hawkins2010-K27me3-IMR90.hg18. -feature Hawkins2010-K9me3-H1.hg18.gtf -feature Hawkins2010-K9me3-IMR90.hg18.g -feature HYPER_IMR90_H1_W100k_MIN10_M60 -feature HYPER_IMR90_NORMAL_W100k_MIN10 -feature HYPER_TUMOR_H1_W100k_MIN10_M60 -feature HYPER_TUMOR_NORMAL_W1k_MIN6_M4 -feature HYPO_H1_W100000_MIN10_M60 -feature HYPO_H1_W20000M100000_MIN20_M2 -feature HYPO_IMR90_W100000_MIN10_M60 -feature HYPO_IMR90_W20000M100000_MIN20 -feature HYPO_NORMAL_W20000M100000_MIN2 -feature HYPO_NORM_W100000_MIN10_M60 -feature HYPO_TUMOR_W20000M100000_MIN20 -feature HYPO_TUM_W100000_MIN10_M60 -feature IMR90_NotPMDs -feature IMR90_PMDs -feature IMR90_ROADMAP_ACCESSIBLE_CHROM -feature IMR90_ROADMAP_H3K4ME3 -feature IMR90_ROADMAP_H3K4ME3_NOTPROMO -feature IMR90_ROADMAP_H3K4ME3_nTSS_nCT -feature K27me3_Ku2008 -feature K27me3_Ku2008_Prmtrs_oriented -feature K9ME2LOCKS_WEN09_20kbbound -feature LADS_GUELEN08 -feature LADS_GUELEN08_20kbbound -feature LADS_GUELEN08_INVERSE -feature LOCKS_PLACENTA_WEN09 -feature NOT_HYPO_IMR90_W100000_MIN10_M -feature NOT_HYPO_TUM_W100000_MIN10_M60 -feature NOT_TJ_GG -feature SUZ12_YOUNG2006 -feature TJ -feature TJ_GG -feature TJ_GG_nonPrmtrExons -feature TJ_NonPrmtrNonExon -feature TJ_Prmtrs_oriented -feature tx -feature txExpanded10kb > $_.feats.3.csv`'
exit 0
